﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data;

namespace BrandUnion.CustomData
{
    public class BookingCompetitionRepository
    {
        public BookingCompetitionRepository()
        {
            Context = new DataContext();
        }
        
        private DataContext Context;
        
        public BookingCompetition GetBookingByEmailAddress(string emailAddress)
        {
            return Context.BookingCompetitions.SingleOrDefault(x => x.EmailAddress == emailAddress);
           
        }

        public void Insert(BookingCompetition item)
        {
            Context.BookingCompetitions.InsertOnSubmit(item);
        }
        public void SaveChanges()
        {
            Context.SubmitChanges();
        }
    }
}
